import request from '@/utils/request'

//分页查询商家
export const getMerchantListAPI = (page, pageSize, merchantName, location) => {
  return request.get('/admin/merchant/page', {
    params: {
      page, // 当前页码
      pageSize, // 每页条数
      merchantName, // 商家名称,用于筛选
      location // 位置，用于筛选
    }
  })
}

//添加商家接口
export const addMerchantAPI = (merchantData) => {
  return request.post('/admin/merchant', null, { params: merchantData })
}

//修改商家信息
export const updateMerchantAPI = (merchantData) => {
  return request.put(`/admin/merchant`, null, { params: merchantData })
}

//删除商家接口
export const deleteMerchantAPI = (merchantId) => {
  return request.delete(`/admin/merchant?merchantId=${merchantId}`)
}

//展示商家详情
export const getMerchantDetailAPI = (merchantId) => {
  return request.get(`/admin/merchant/detail?merchantId=${merchantId}`)
}
